<?php
/**
 * 主导航菜单组件
 */
    namespace app\commands\front;
    use yii\base\Widget;
    use yii;

	class UcenterWidget extends Widget  {
        public $session;
        public $now_path;
        public $controller;

        /**
         * 定义函数
         * */
        public function init()
        {
            $this->url();
        }

        /**
         * 运行覆盖程序
         * */
        public function run(){
            $this->controller = Yii::$app->controller->id;

            return $this->render('ucenter',['controller' => $this->controller]);
        }

        public function url(){
            $this->now_path=ltrim($_SERVER['REQUEST_URI'],'/');
        }
    }
?>

